/*
 *                                |~~~~~~~|
 *                                |       |
 *                                |       |
 *                                |       |
 *                                |       |
 *                                |       |
 *     |~.\\\_\~~~~~~~~~~~~~~xx~~~         ~~~~~~~~~~~~~~~~~~~~~/_//;~|
 *     |  \  o \_         ,XXXXX),                         _..-~ o /  |
 *     |    ~~\  ~-.     XXXXX`)))),                 _.--~~   .-~~~   |
 *      ~~~~~~~`\   ~\~~~XXX' _/ ';))     |~~~~~~..-~     _.-~ ~~~~~~~
 *               `\   ~~--`_\~\, ;;;\)__.---.~~~      _.-~
 *                 ~-.       `:;;/;; \          _..-~~
 *                    ~-._      `''        /-~-~
 *                        `\              /  /
 *                          |         ,   | |
 *                           |  '        /  |
 *                            \/;          |
 *                             ;;          |
 *                             `;   .       |
 *                             |~~~-----.....|
 *                            | \             \
 *                           | /\~~--...__    |
 *                           (|  `\       __-\|
 *                           ||    \_   /~    |
 *                           |)     \~-'      |
 *                            |      | \      '
 *                            |      |  \    :
 *                             \     |  |    |
 *                              |    )  (    )
 *                               \  /;  /\  |
 *                               |    |/   |
 *                               |    |   |
 *                                \  .'  ||
 *                                |  |  | |
 *                                (  | |  |
 *                                |   \ \ |
 *                                || o `.)|
 *                                |`\\) |
 *                                |       |
 *                                |       |
 *
 * @Descripttion:
 * @version:
 * @Date: 2022-02-22 09:48:35
 * @LastEditors: huzhushan@126.com
 * @LastEditTime: 2022-04-06 15:36:49
 * @Author: huzhushan@126.com
 * @HomePage: https://huzhushan.gitee.io/vue3-element-admin
 * @Github: https://github.com/huzhushan/vue3-element-admin
 * @Donate: https://huzhushan.gitee.io/vue3-element-admin/donate/
 */
const Mock = require('mockjs')
const tokens = {
  admin: {
    token: 'admin-token',
  },
  editor: {
    token: 'editor-token',
  },
}

const users = {
  'admin-token': {
    roles: ['admin'],
    introduction: 'I am a super administrator',
    avatar:
      'https://wpimg.wallstcn.com/f778738c-e4f8-4870-b634-56703b4acafe.gif',
    name: 'Super Admin',
  },
  'editor-token': {
    roles: ['editor'],
    introduction: 'I am an editor',
    avatar:
      'https://wpimg.wallstcn.com/f778738c-e4f8-4870-b634-56703b4acafe.gif',
    name: 'Normal Editor',
  },
}

module.exports = [
  // user login
  {
    url: '/web/main/login',
    type: 'post',
    // timeout: 3000,
    response: config => {
      return {
        code: 1,
        msg: '登录成功',
        data: {
          xz_token: 'sdkl235jfaswioequrer589oewqurlfjla4567sdjflaksdjf',

        },
      }
    },
  },

  // get user info
  {
    url: '/web/main/index',
    type: 'post',
    response: config => {
      return {
        code: 1,
        data: {
          sp_name: '杭州阿里巴巴科技有限公司',
          user_name: '马云',
          role_name: '超级管理员',
          email: 'mayun@alibaba.com',
          'balance': '@float(0, 999, 2, 2)',
          'freeze': '@float(0, 999, 2, 2)',
          'handle|1-999': 99,
        },
      }
    },
  },

  // user logout
  {
    url: '/vue-element-admin/user/logout',
    type: 'post',
    response: _ => {
      return {
        code: 1,
        data: 'success',
      }
    },
  },

  // 获取验证码
  {
    url: '/web/comm/code',
    type: 'post',
    timeout: 500,
    response: _ => {
      return {
        code: 1,
        data: {
          captcha:
            '',
        },
      }
    },
  },
  // 获取菜单
  {
    url: '/web/main/menu',
    type: 'post',
    // timeout: 3000,
    response: _ => {
      return {
        code: 1,
        msg: 'success',
        data: {
          list: [
            {
              id: 1,
              name: '消息平台',
              key: 'MessagePlatform',
              list: [
                {
                  id: 110,
                  name: '我的应用',
                  key: 'MyApplications',
                },
                {
                  id: 111,
                  name: '微信公众号迁入',
                  key: 'WxImport',
                },
                {
                  id: 112,
                  name: '制作推广海报',
                  key: 'Poster',
                },
                {
                  id: 120,
                  name: '媒体库',
                  key: 'Medias',
                },
                {
                  id: 130,
                  name: 'H5页面库',
                  key: 'Html5',
                },
                {
                  id: 140,
                  name: '消息模板',
                  key: 'Message-template',
                },
                {
                  id: 150,
                  name: '公共模板库',
                  key: 'Common-templates',
                },
                {
                  id: 170,
                  name: '用户',
                  key: 'Users',
                },
                {
                  id: 180,
                  name: '通讯录',
                  key: 'Contacts',
                },
                {
                  id: 190,
                  name: '黑白名单',
                  key: 'Black-white-list',
                },
                {
                  id: 1110,
                  name: '消息助手',
                  key: 'Group-send',
                },
                {
                  id: 1120,
                  name: '任务管理',
                  key: 'Tasks',
                },
                {
                  id: 1130,
                  name: '收发记录',
                  key: 'Logs',
                },
                {
                  id: 1140,
                  name: 'API接口文档',
                  key: 'Api-docs',
                },
              ],
            },
            {
              id: 2,
              name: '账号管理',
              key: 'AccountManage',
              list: [
                {
                  id: 210,
                  name: '商城',
                  key: 'Shopping',
                },
                {
                  id: 211,
                  name: '产品详情',
                  key: 'ShoppingDetail',
                },
                {
                  id: 212,
                  name: '订单支付',
                  key: 'ShoppingPay',
                },
                {
                  id: 220,
                  name: '我的订单',
                  key: 'MyOrder',
                },
                {
                  id: 230,
                  name: '充值',
                  key: 'Recharge',
                },
                {
                  id: 240,
                  name: '财务记录',
                  key: 'Finance',
                },
                {
                  id: 250,
                  name: '通知',
                  key: 'Notice',
                },
                {
                  id: 260,
                  name: '成员管理',
                  key: 'Member',
                },
                {
                  id: 270,
                  name: '修改密码',
                  key: 'Password',
                },
                {
                  id: 280,
                  name: '账号信息',
                  key: 'Profile',
                },
                {
                  id: 290,
                  name: '操作记录',
                  key: 'Operation',
                },
                {
                  id: 2100,
                  name: '工单',
                  key: 'Feedback',
                },
              ],
            },
          ],
        },
      }
    },
  },

  // 首页统计
  {
    url: '/web/main/total',
    type: 'post',
    timeout: 300,
    response: config => {
      return {
        code: 1,
        data: Mock.mock({
          tdr: '@integer(1, 100)',
          tds: '@integer(1, 100)',
          ydrn: '@integer(1, 100)',
          ydsn: '@integer(1, 100)',
          ydr: '@integer(1, 100)',
          yds: '@integer(1, 100)',
        }),
      }
    },
  },

  // 首页快速菜单
  {
    url: '/web/main/quick',
    type: 'post',
    timeout: 400,
    response: config => {
      return {
        code: 1,
        data: {
          list: [
            {
              id: 110,
              name: '我的应用',
              key: 'MyApplications',
            },
            {
              id: 120,
              name: '媒体库',
              key: 'Medias',
            },
            {
              id: 130,
              name: 'H5页面库',
              key: 'Html5',
            },
            {
              id: 1110,
              name: '消息助手',
              key: 'Group-send',
            },
            {
              id: 1120,
              name: '任务管理',
              key: 'Tasks',
            },
            {
              id: 1140,
              name: 'API接口文档',
              key: 'Api-docs',
            },
            {
              id: 190,
              name: '黑白名单',
              key: 'Black-white-list',
            },
            {
              id: 140,
              name: '消息模板',
              key: 'Message-template',
            },
            {
              id: 290,
              name: '操作记录',
              key: 'Operation',
            },
          ]
        },
      }
    },
  },

  // 首页消息列表
  {
    url: '/web/main/msg',
    type: 'post',
    timeout: 500,
    response: config => {
      return {
        code: 1,
        data: {
          'list|5': [{
            'id|+1': 1,
            'title': '@ctitle',
            'content': '@cparagraph',
            'utime': '@datetime'
          }]
        },
      }
    },
  },

  // 我的应用列表
  {
    url: '/web/app/list',
    type: 'post',
    timeout: 500,
    response: config => {
      return {
        code: 1,
        data: {
          page: 1,
          rows: 10,
          total: 1000,
          'list|10': [{
            'id|+1': 1,
            'app_id': '@guid',
            'name': '@ctitle',
            'file': 'https://wpimg.wallstcn.com/e4558086-631c-425c-9430-56ffb46e70b3',
            province: '广东省',
            city: '深圳市',
            'industry|1-8': 1,
            white: '15811206176|13677765678',
            desc: '@cparagraph',
            'port|80-9999': 1,
            indust: '@integer(111887239, 93485430985)',
            cb_tel: '18866668888',
            email: '@email',
            url_index: '@url',
            address: '@region',
            lnglat: '',
            url_terms: '@url',
            url_pic: 'https://wpimg.wallstcn.com/e4558086-631c-425c-9430-56ffb46e70b3',
            color: '255|0|0',
            menuList: [
              {
                id: 1,
                name: '个人中心',
                type: 1,
                content: 'asdlfkjsadlf',
                phone: '',
                link: '',
                browser: '2',
                height: '1',
                menuList: [
                  {
                    id: 11,
                    name: '登录',
                    type: 3,
                    content: '',
                    phone: '',
                    link: 'http://qq.com',
                    browser: '2',
                    height: '1',
                  },
                  {
                    id: 12,
                    name: '视频通话',
                    type: 2,
                    content: '',
                    phone: '45658756856',
                    link: '',
                    browser: '2',
                    height: '1',
                  },
                ],
              },
            ],
          }]
        },
      }
    },
  },

  {
    url: '/web/app/delete',
    type: 'post',
    timeout: 100,
    response: _ => {
      return {
        code: 1,
        msg: '操作成功',
      }
    },
  },

  // 媒体库列表
  {
    url: '/web/media/list',
    type: 'post',
    timeout: 500,
    response: config => {
      return {
        code: 1,
        data: {
          page: 1,
          rows: 10,
          total: 1000,
          'list|10': [{
            'id|+1': 1,
            'media_id': '@guid',
            'media_name': '@ctitle',
            'media_type|1-5': 1,
            create_time: '@datetime',
            media_url: 'https://wpimg.wallstcn.com/e4558086-631c-425c-9430-56ffb46e70b3',

          }]
        },
      }
    },
  },

  {
    url: '/web/media/file_del',
    type: 'post',
    timeout: 100,
    response: _ => {
      return {
        code: 1,
        msg: '操作成功',
      }
    },
  },

  {
    url: '/web/media/folder_del',
    type: 'post',
    timeout: 100,
    response: _ => {
      return {
        code: 1,
        msg: '操作成功',
      }
    },
  },

  {
    url: '/web/media/file_remove',
    type: 'post',
    timeout: 500,
    response: _ => {
      return {
        code: 1,
        msg: '移动成功',
      }
    },
  },

  {
    url: '/web/media/folder_list',
    type: 'post',
    timeout: 100,
    response: _ => {
      return {
        code: 1,
        data: [
          {
            folder_path: '/'
          },
          {
            folder_path: '/我的图片'
          },
          {
            folder_path: '/我的图片/风景'
          },
          {
            folder_path: '/我的音频'
          },
          {
            folder_path: '/我的音频/周杰伦'
          },
          {
            folder_path: '/我的视频'
          },
          {
            folder_path: '/我的视频/5G生活'
          }
        ]
      }
    },
  },

]
